package km.TestDialog;

import android.R.*;
import android.app.*;
import android.content.*;
import android.os.*;
import android.view.*;
import android.view.View.*;
import android.widget.*;

public class TestDialog extends Activity {
    private Button btn;
	private AlertDialog ad;

	/** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);


         btn = (Button)findViewById(R.id.Button01);
        btn.setOnClickListener(new OnClickListener() {
			
			public void onClick(View v) {
				new AlertDial(TestDialog.this).show();
			}
		});

    }
    private void showDialog(){
        LayoutInflater factory = LayoutInflater.from(this);
        final View textEntryView = factory.inflate(R.layout.alert_dialog_text_entry, null);
            ad= new AlertDialog.Builder(this)
//            .setTitle("title")
//            .setMessage("message")
            .setView(textEntryView)
            .setCancelable(false).show();
//            .setPositiveButton(string.ok,
//                    new DialogInterface.OnClickListener() {
//                        public void onClick(DialogInterface dialog, int which) {
//                            dialog.dismiss();
//                        }
//                    }).show();
            textEntryView.findViewById(R.id.Button01).setOnClickListener(new OnClickListener() {
    			
    			public void onClick(View v) {
    				   ad.dismiss();
    			}
    		});
    }
    private void showDialogs(){
//    	ad= new AlertDial.Builder(this)
//            .setTitle("title")
//            .setMessage("message")
//    	.setCancelable(false).show();
//            .setPositiveButton(string.ok,
//                    new DialogInterface.OnClickListener() {
//                        public void onClick(DialogInterface dialog, int which) {
//                            dialog.dismiss();
//                        }
//                    }).show();
//    	textEntryView.findViewById(R.id.Button01).setOnClickListener(new OnClickListener() {
//    		
//    		public void onClick(View v) {
//    			ad.dismiss();
//    		}
//    	});
    }
}